package com.beiing.tianshuai.tianshuai.mine.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.ListUserBean;
import com.beiing.tianshuai.tianshuai.mine.model.MessageModel;
import com.beiing.tianshuai.tianshuai.mine.model.MessageModelImpl;
import com.beiing.tianshuai.tianshuai.mine.view.MessageViewImpl;

/**
 * Created by Jinni on 2017/8/7 0007.
 */

public class MessagePresenter extends BasePresenter implements MessagePresenterImpl, MessageModel.OnRequestListener {

    private MessageModelImpl mModel;
    private MessageViewImpl mView;

    public MessagePresenter(MessageViewImpl view) {
        mView = view;
        mModel = new MessageModel(this);
    }

    @Override
    public void getUsersInfo(String users, String groups) {
        mView.showProgress();
        mModel.getUsersInfo(users, groups);
    }

    @Override
    public void onSuccess(ListUserBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onError(Throwable e) {
        mView.hideProgress();
        mView.onRequestFailed(e);
    }
}
